package com.yix.jpademo.entity;

import lombok.Data;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;

@Entity
@Data
@Table(
        name = "sys_dept"
)
public class Dept{
    @Id
    @Column(
            name = "id",
            length = 32,
            nullable = false,
            columnDefinition = "varchar(32) COMMENT '主键id'"
    )
    @GenericGenerator(
            name = "uuid2",
            strategy = "org.hibernate.id.UUIDHexGenerator"
    )
    @GeneratedValue(
            generator = "uuid2"
    )
    protected String id;

    private Integer num;
    @Column(columnDefinition = "varchar(20) COMMENT 'code'")
    private String pid;
    @Column(columnDefinition = "varchar(20) COMMENT '父级code'")
    private String pids;
    @Column(columnDefinition = "varchar(20) COMMENT '简称'")
    private String simplename;
    @Column(columnDefinition = "varchar(20) COMMENT '全称'")
    private String fullname;
}